Repository navigation
[Spec 1951] Read-only PR check for architects: codev check pr | deploy | worktree - #1958
Draft
waleedkadous wants to merge 64 commits into
Draft
waleedkadous wants to merge 64 commits into
waleedkadous wants to merge 64 commits into
Conversation
…n context (architect, 2026-11-23)
… PR mechanics - pr-view gains optional headRefOid, isDraft, mergeable, mergeStateStatus, mergeCommit, mergedAt, reviewDecision (github, gitlab, gitea) - new read concepts commit-checks and workflow-runs: github implements them, gitlab and gitea disable them explicitly (no silent fall-through to gh) - dispatcher: timeoutMs option and a timedOut flag on ForgeCommandError - gitlab pr-view now captures before piping (#1645) and declares forge-executable: glab (#1455); it also maps body/baseRefName/headRefName - forge.md documents the concepts and fields
…ries the new nullable fields
…ab empty-output guard and body default, paginate legacy statuses
… settings, report core and git plumbing - allow-list.ts: closed per-subcommand git grammar; diff/log/show forced to --no-ext-diff --no-textconv; ref-neutral fetch only; four read forge concepts - runner.ts: the only subprocess path; argv spawn, GIT_TERMINAL_PROMPT=0, ls-remote/fetch and forge calls bounded, with its own deadline race - validate.ts, roots.ts (roots from git), settings.ts (check.* with key+file on error) - report.ts (schema 1, verdict, exit codes, check.skip, summarizeRuns), render.ts - git-facts.ts: live tips, ensureCommits, ancestry, :(top,glob) pathspec filters - test helpers: fixture repos with state snapshot, stub git/gh PATH recorders - audited-imports test keeps child_process and the forge dispatcher in runner.ts
…ks arguments, not only flags - stub ls-remote: origin only, then HEAD or refs/… names (no ::, no ..) - stub revision-taking subcommands refuse path and URL arguments, closing the implicit --no-index diff of files outside the repository - stub ls-files/status take no arguments before --; for-each-ref refs/ only - shared refusal cases for all of the above, refused by both layers - liveTip rejects an invalid branch name without running git
…p path (tmp-residue check)
…echanics - `codev check pr <N> [--json]`: anchors on the forge's head SHA and the live base tip (ls-remote), fetching missing objects ref-neutrally - checks head (local branch vs PR head; compared only when origin's branch is the PR head, so a fork's PR is not misread), attribution, trial-merge (merge-tree --write-tree), watched/flagged, overlap, size, to-read - re-reads pr-view and ls-remote at the end; a head or base that moved needs attention, even on a skipped check - `codev check` group: help exits 0, usage errors exit 2, a --json usage error prints the ErrorReport - tests: stub gh/git scenarios (POSIX), real-repo snapshots and races (all platforms), CLI wiring, parsers; fixes a type error in allow-list.test.ts
…e, CI on the code, linked issue All eleven checks of `codev check pr` are now present: - state: an open PR that is not a draft (OPENED → OPEN, a merge time → MERGED); a draft can never read CLEAR. - forge: the verdict follows `mergeable` alone; the merge state and review decision are context; an UNKNOWN takes the end-of-run re-read once. - checks (porch-only.ts): find the last code commit past porch-only commits (at most 10), choose the code runs with at most 10 commit-checks lookups, and show code and head on two lines so "still running" reads apart from "failed". - linked-issue (linked-issue.ts): GitHub's closing keywords against the builder branch's issue. Phase 3 review fold-ins: commander exits throw CheckExit carrying their writes, and cli.ts flushes them before exiting; `head` is attention when origin's branch is past the forge head (a push the forge has not indexed); localBranchSha in the not-origin-branch details; commander may be imported by index.ts only.
…t the walk and the forge did not provide - forge: a merge state the forge did not report is said on the line, `MERGEABLE (merge state not reported)`; the verdict still follows `mergeable` alone. - checks: a git call in the porch-only walk that fails leaves the check `not run` by name, and the other checks are still reported (was exit 2). - The one-line form is chosen by SHA, not object identity. - The walk's rev-list and two-revision diff-tree forms are in the shared form table. - Tests: a pr-view without mergeStateStatus, a failing diff-tree, and main merged into a porch-only branch (C is the merge; main's commit is never looked up).
…n-branch, deploy-run, merge-checks Per PR from pr-view: merged with a merge commit; the merge an ancestor of the live tip of check.deploy.branch (else the PR's base); with check.deploy.workflow, inside the newest green run of that workflow on the branch (workflow-runs), its head fetched ref-neutrally when missing; without one, CI on the merge commit. A PR that cannot be read is a per-PR not run; the verdict is the worst.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft, opened early for CI only. Under the owner's standing ruling main-32, GitHub's run on this head can stand in for porch's local
testscheck, which fails when the machine is under load (issue #1956). This is not ready for review.Spec:
codev/specs/1951-read-only-pr-check-for-archite.md. Plan:codev/plans/1951-read-only-pr-check-for-archite.md, 7 phases.Committed so far:
pr-viewgains the optional fieldsheadRefOid,isDraft,mergeable,mergeStateStatus,mergeCommit,mergedAtandreviewDecision.commit-checksandworkflow-runs. GitHub implements them; gitlab and gitea disable them explicitly.timeoutMsoption and atimedOutflag on errors.pr-viewnow capturesglab's output before piping it tojq(tower: overview cache burns the user's entire GitHub GraphQL quota (3 gh calls × N workspaces every 30s, failures uncached) — every gh command on the machine then fails #1645) and declaresforge-executable: glab(pr-create is not a forge concept: gh pr create is hardcoded in the skeleton prompts, so non-GitHub forges need a gh shim #1455).Commits no reviewer has seen (look at these specifically)
Porch force-advanced Phase 2 (
readonly_core) at its 3-iteration ceiling, so CMAP never re-reviewed the round-3 fix:aa7e34f58:git'sls-remoteaccepts onlyorigin, thenHEADorrefs/…names.--no-indexdiff of files outside the repository.ls-filesandstatustake no arguments, andfor-each-refacceptsrefs/patterns only.liveTipbranch-name guard.c42251ec5: theext::refusal case no longer uses a/tmppath (the tmp-residue check).Both commits are confined to
commands/check/test helpers, plus the one-line guard ingit-facts.ts.The full description comes at the
prgate.Fixes #1951
Local tests check skipped once, under owner ruling main-32.
Phase 1 (
forge_read_concepts), headbb2ad2710.Porch's local
testscheck failed under machine load (tests: one run of the packages/codev unit suite takes an 18-core Mac from load 8 to 59, and its own spawn-heavy tests then time out #1956). The failing tests were unrelated to this change and each passed alone, and the builder's own full run passed.The architect confirmed GitHub's run on this PR at
bb2ad2710was 8/8 green.porch.checks.tests.skipwas set in the worktree's own.codev/config.local.jsonfor a singleporch doneand removed in the same command. It was never committed. The build check still ran and passed.Phase 2 (
readonly_core), head9081d4367.porch doneat load 9.5. Itstestscheck failed on four unrelated, spawn-heavy files:agy-auth-cache,windows-console-spawn-guard,pir-1233-session-launch-loopandbugfix-1267-launch-loop. Porch's output did not name them (porch done truncates failing check output; the failing test is never named #1853); vitest's results cache did.9081d4367was 8/8 green. The skip was then applied once, in the same way, and the build check passed.Phase 3 (
check_pr_mechanics), head5bef2f503, under owner ruling main-38 ("ci-first": no local full suite until tests: one run of the packages/codev unit suite takes an 18-core Mac from load 8 to 59, and its own spawn-heavy tests then time out #1956 is fixed).porch done. Locally: the targeted tests (551/551 in 14 files), the build and the type-check.5bef2f503was 8/8 green. The skip was then applied once, in the same way, and the build check passed.Phase 4 (
check_pr_forge), head410d5ec14, under the same ruling main-38.No local full-suite run and no plain
porch done. Locally: the targeted tests (644/644 in 17 files), the build, and the type-check on the source and on the check tests.The architect confirmed GitHub's run at
410d5ec14was 8/8 green. The skip was then applied once, in the same way, and the build check passed.Review iteration 1 fixes, head
e1cece6f6: targeted tests 664/664, build. The architect confirmed GitHub's run ate1cece6f6was 8/8 green. The skip was then applied once, in the same way, and the build check passed.Phase 5 (
check_deploy), head53f7e6522, under the same ruling main-38.porch done. Locally: the targeted tests (719/719 in 19 files), the build, and the type-check on the source and on the check tests.53f7e6522was 8/8 green. The skip was then applied once, in the same way, and the build check passed.